/*
 * Banque.java
 *
 * Created on 16 avril 2007, 20:57
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package Entity;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;

/**
 * Entity class Banque
 * 
 * @author yas-nico
 */
@Entity
public class Banque  extends Entreprise implements Serializable {

    private double montant_Emprunt;
    private int duree_Emprunt;
    private double tauxPropose;
    private int dureePropose;
    private int nb_offre_emploi;
    
    @OneToMany(fetch=FetchType.EAGER,cascade=CascadeType.ALL)
    private Collection <Emprunt> sesOffresEmprunts;

    /** Creates a new instance of Banque */
    public Banque() {
    }
    public Banque(/*int id,*/ double capital_Entreprise, String nom_Entreprise, double remuneration_Entreprise,
             double mont, int duree_Emp, double tauxProp, int dureeP)
    {
        super( /*id,*/  capital_Entreprise,  nom_Entreprise,  remuneration_Entreprise);
        montant_Emprunt=mont;
        duree_Emprunt=duree_Emp;
        tauxPropose=tauxProp;
        dureePropose=dureeP;
        nb_offre_emploi=0;
    }
    /**
     * Gets the id of this Banque.
     * @return the id
     */

    public double getMontant_Emprunt() {
        return montant_Emprunt;
    }

    public void setMontant_Emprunt(double montant_Emprunt) {
        this.montant_Emprunt = montant_Emprunt;
    }

    public int getDuree_Emprunt() {
        return duree_Emprunt;
    }

    public void setDuree_Emprunt(int duree_Emprunt) {
        this.duree_Emprunt = duree_Emprunt;
    }

    public double getTauxPropose() {
        return tauxPropose;
    }

    public void setTauxPropose(double tauxPropose) {
        this.tauxPropose = tauxPropose;
    }

    public int getNb_offre_emploi()
    {
        return nb_offre_emploi;
    }

    public void setNb_offre_emploi(int nb_offre_emploi)
    {
        this.nb_offre_emploi = nb_offre_emploi;
    }

    public Collection<Emprunt> getSesOffresEmprunts()
    {
        return sesOffresEmprunts;
    }

    public void setSesOffresEmprunts(Collection<Emprunt> sesOffresEmprunts)
    {
        this.sesOffresEmprunts = sesOffresEmprunts;
    }
    
    public void addOffreEmprunt(Emprunt e)
    {
        sesOffresEmprunts.add(e);
    }
    

}
